package com.ksd.modules.rbac.sysuser.po;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

/**
 * @author 飞哥
 * @date 2023-08-03$ 10:28$
 */
@Data
@ApiModel(value = "用户注册参数")
public class UserRegisterPO implements java.io.Serializable{

    @ApiModelProperty(value="用户名",required = true)
    @NotBlank(message="用户名不能为空")
    @Pattern(regexp = "^[0-9A-Za-z]{6,16}$",message = "请输入6~16位只包含数字和字母的用户名")
    private String username;

    @ApiModelProperty(value="密码",required = true)
    @NotBlank(message="密码不能为空")
    @Length(min=6,max = 16,message = "请输入6~16位的密码")
    private String password;

    @ApiModelProperty(value="密码问题",required = true)
    @NotBlank(message="密码问题不能为空")
    @Length(max=100,message = "密码问题不能超过100个字符")
    private String question;

    @ApiModelProperty(value="密码答案",required = true)
    @NotBlank(message="密保答案不能为空")
    @Length(max=100,message = "密保不能超过100个字符")
    private String answer;

}
